<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Insert title here</title>
        <include file="Public:easyui_res" />

    </head>
    <body >
	<div class="easyui-panel" title="{$title}" style="width:100%;height: 500px">
		<div style="padding:10px 60px 20px 60px;margin-top: 100px;text-align: center;">
		<h1>39健康管家 发送下载APP链接手机短信</h1>
	    <form id="ff" method="post" action="__URL__/edit" style="margin-top: 100px;">
	    	手机号码：
	    			<input class="easyui-numberbox" type="text"  id="mobile" name="mobile" data-options="required:true,prompt:'请输入手机号码'"></input>
	    		 	<a href="javascript:void(0);" class="easyui-linkbutton"  onclick="submitForm()" data-options="iconCls:'icon-ok'" style="width:100px;height:25px;margin-left: 20px;">发送</a>
	    	</form>
	    		<div id="hint" style="margin-top: 20px;"></div>
	    </div>
	</div>

<script type="text/javascript">
function submitForm(){
	$('#ff').form('submit',{
		onSubmit:function(){
			var json = form2Json("ff");
			var form_valid = $(this).form('enableValidation').form('validate');
			if(!form_valid ){
				return false; 
			}
			var mobile = $("#mobile").val();
			if(mobile.length != 11){
				m_info("请输入正确的手机号码");
				return false;
			}
			var obj = new Object();
			obj["mobile"] = mobile;
			$.messager.confirm('提示', '确定要向手机号'+mobile+'发送短信链接吗?', function(r){
				if (r){
					 $.post('__URL__'+"/send/"+Math.random(),obj, function(data) {
						 if(data == 0 ){ //影响行0则成功
						 	$("#hint").html("已成功向"+mobile+"用户发送短信！");
						 }else{
							 $("#hint").html("发送失败");
							 alert(data);
						 }
				     });
				}
			});
			 return false;
		}
	});
	

}
</script>
    </body>
</html>

